The check box and radio buttons also fire the onclick event. Register the showEvent function as event
handler as shown below.
<input id="ch1" dojoType="dijit.form.CheckBox" checked="checked“ value="Y" onclick="showEvent"/>
<label for="ch1">Send me e-mail</label> <br /> <input id="rad1" dojoType="dijit.form.RadioButton" checked="checked" name="vendor" value="IBM" onclick="showEvent"/> <label for="rad1">IBM</label> <input id="rad2" dojoType="dijit.form.RadioButton" name="vendor" value="MS" onclick="showEvent"/> <label for="rad2">Microsoft</label> <input id="rad3" dojoType="dijit.form.RadioButton" name="vendor" value="Oracle" onclick="showEvent"/> <label for="rad3">Oracle</label> <input dojoType="dijit.form.DateTextBox" onchange="showNewValue"/> <br /> <select dojoType="dijit.form.ComboBox" autocomplete="true" value="Enter a state" onchange="showNewValue"> <option selected="selected">California</option> <option>Illinois</option> <option>New York</option> <option>Nebraska</option> </select>
function showNewValue(val) {
console.debug("User entered: " + val); } |